<ul class="nav nav-tabs nav-stacked categories">
        <?php foreach ($category as $k => $item) :  ?>
            <?php if (!empty($item['sub'])) : ?>
                <li class="dropdown-submenu <?php echo ($k == $item['ProductType']['id']) ? 'active' : ''; ?>">
                        <a href="#">
                             <?php echo $item['ProductType']['name_'.$lang]; ?>
                        </a>
                    <ul class="dropdown-menu active">
                        <?php foreach ($item['sub'] as  $i) { ?>
                        <li>
                                <a href="<?php echo Router::url(array('plugin' => null,'controller'=>'product','action'=>'view',$i['ProductType']['id'])); ?>" title="<?php echo $i['ProductType']['name_'.$lang]; ?>"><?php echo $i['ProductType']['name_'.$lang]; ?></a>
                        </li>
                        <?php } ?>
                    </ul>
                </li>
                <?php else : ?>
                <li <?php echo ($k == $item['ProductType']['id']) ? 'class="active"' : ''; ?>><a href="<?php echo Router::url(array('plugin' => null, 'controller'=>'product','action'=>'view',$item['ProductType']['id'])); ?>">
                        <?php echo $item['ProductType']['name_'.$lang]; ?>
                        </a>
                </li>
            <?php endif; ?>
        <?php endforeach; ?>
</ul>